<%-- 
    Document   : AddVipOk
    Created on : 2014/2/26, 下午 07:28:27
    Author     : Gjun
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%  //是錯誤 失敗的檔案
    request.setCharacterEncoding("UTF-8");
    String login_account=request.getParameter("login_account");
    String login_password=request.getParameter("login_password");
    String user_name=request.getParameter("user_name");
    String sex=request.getParameter("sex");
    String birth_year=request.getParameter("birth_year");
    String birth_month=request.getParameter("birth_month");
    String birth_day=request.getParameter("birth_day");
    String county=request.getParameter("county");
    String region=request.getParameter("region");
    String address=request.getParameter("address");
    String phone=request.getParameter("phone");
    String email=request.getParameter("email");
   
    String birthday=birth_year+"/"+birth_month+"/"+birth_day;
    
    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
    java.sql.Connection con = java.sql.DriverManager.getConnection(
        "jdbc:sqlserver://10.10.2.171:1433;databaseName=javadb", "javadb", "javadb");
    String sql="insert into account_test_only values (?,?,?,?,?,?,?,?,?,?) ";
    java.sql.PreparedStatement st = con.prepareStatement(sql);
    st.setString(1,login_account);
    st.setString(2, login_password);
    st.setString(3, user_name);
    st.setString(4, sex);
    st.setString(5, birthday);
    st.setString(6, county);
    st.setString(7, region);
    st.setString(8, address);
    st.setString(9, phone);
    st.setString(10, email);
    int x=st.executeUpdate();
    
    st.close();
    con.close();
%>  
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
         <%out.println("修改:" +"筆資料");%>
        <%= login_account%> <br><%= user_name%><br><%= phone%><br><%= address%><br> <%= birthday%><br><br>
        <a  href='AddVip_test.jsp'>回到　　　　加入會員         列表!</a>
        <h1>Hello World!</h1>
    </body>
</html>
